// Author: Domien Nowicki, Bjorn Schobben


#ifndef RAPIDRAYCAST_H
#define RAPIDRAYCAST_H

#include <QMainWindow>
#include <QVBoxLayout>
#include "ui_RapidRaycast.h"
#include "TextureManagerView.h"
#include "WorldEditorWidget.h"
#include "RaycasterWidget.h"
#include "ResizeDialog.h"
#include "HelpBrowser.h"

class RapidRaycast : public QMainWindow
{
    Q_OBJECT

public:
    RapidRaycast(QWidget *parent = 0, Qt::WFlags flags = 0);
    virtual ~RapidRaycast();

protected:
	void closeEvent(QCloseEvent* e);

private slots:
	void on_actionToolPreview_activated();
	void on_actionToolResize_activated();

	void on_actionPreview_activated();
	void on_actionResize_activated();
	void on_actionNew_activated();
	void on_actionLoad_activated();
	void on_actionSave_activated();
	void on_actionSaveAs_activated();
	void on_actionChange_default_texture_activated();
	void on_actionChange_default_floor_activated();
	void on_actionChange_default_ceiling_activated();
	void on_actionHelpContents_activated();
	void on_actionTutorial_activated();
	void on_actionAbout_activated();
	void on_actionAboutQt_activated();
	void on_actionOpenGLRenderer_activated();
	void on_actionSoftwareRenderer_activated();
	

	void slotResize(unsigned int width, unsigned int height);
	void slotChanged();

private:
	void UpdateStates();
	void InitializeHelp();
	void SaveWorld(const QString& file);

    Ui::RapidRaycastClass ui;
	WorldEditorWidget *world;
	ResizeDialog *resizeDialog;

	RaycasterWidget *raycast;
	QVBoxLayout *vboxLayout;
	QString mapFilename;
	HelpBrowser *help;
};

#endif // RAPIDRAYCAST_H